Skip to content

fix(bump-submodules): end of input aborts instead of accepting every prompt - #1572

Open
TimeToBuildBob wants to merge 5 commits into
ActivityWatch:masterfrom
TimeToBuildBob:fix/bump-submodules-eof-is-not-yes
Open

TimeToBuildBob wants to merge 5 commits into
ActivityWatch:masterfrom
TimeToBuildBob:fix/bump-submodules-eof-is-not-yes

Conversation

@TimeToBuildBob

Copy link
Copy Markdown
Contributor

confirm() in scripts/bump-submodules.sh treats an empty answer as yes (Enter accepts). When read hits end of input it fails and leaves answer empty. Every confirm call sits inside if or ||, so set -e doesn't stop the script. Running without --yes from a non-terminal stdin (an agent shell, cron, < /dev/null) therefore accepts every commit and push prompt. Because PUSH=1 is the default, those commits go straight to master.

Fix: a failed read now aborts the run and tells you to pass --yes for unattended runs. Interactive Enter/n/q work as before.

Test: scripts/tests/test_bump_submodules.py extracts confirm() and runs it against real stdin. It is wired into the release workflow's test job next to the other script tests.

  • Before the fix: the two end-of-input cases fail (ACCEPTED).
  • After the fix: 6 passed.

Found in a packaging-scripts review; the reproduction was independently verified.

…prompt

confirm() read an empty answer as "yes" (Enter accepts), and a failed
read at end of input left answer empty. Every confirm call sits inside
if/||, so set -e did not stop it: with stdin closed or not a terminal
and no --yes, the script committed and pushed straight to master.

Git-Session-Id: 686b7c0e-aee4-4c6e-bbb4-78e915e2bb44
@greptile-apps

greptile-apps Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] Safe to merge; running out of input no longer approves commits or pushes.

Summary

The submodule bump script now stops when a prompt runs out of input instead of treating it as approval.

  • Submodule prompts abort when stdin ends before an answer.
  • The Tauri lock update cleans itself up when its commit stops early.

Reviews (5) · Last reviewed commit: "fix(bump-submodules): clean up a failed ..." · Reviewed by Greptile

Comment thread scripts/bump-submodules.sh Resolved
Git-Session-Id: f12543bf-d72f-5ed6-97cb-cee929da5b44
@TimeToBuildBob

This comment has been minimized.

Comment thread scripts/bump-submodules.sh Resolved
@TimeToBuildBob

TimeToBuildBob commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 AI code review

The PR changes confirm() to abort when read fails. It adds restore_relock() and an EXIT trap to restore uncommitted Cargo.lock changes after an aborted or failed relock. It also adds prompt and relock tests and runs them in the release workflow.

Safe to merge — no P0/P1 findings

Confidence 5/5

✅ No findings. The diff looks correct to me on this pass.

Files changed (3) — the diff as I read it
  • .github/workflows/release.yml — Adds a pytest step for scripts/tests/test_bump_submodules.py.
  • scripts/bump-submodules.sh — Aborts on failed prompt reads and adds hash comparisons and EXIT cleanup around the Cargo.lock relock and commit.
  • scripts/tests/test_bump_submodules.py — Adds subprocess tests for interactive answers, EOF, relock cleanup, commit failure, and edits made during confirmation.
Previous review passes
commit score findings engine when
8c7dea64c967 4/5 1 llm 2026-11-24 10:29 UTC
920947a037df 4/5 1 subscription 2026-11-24 17:09 UTC
8a3c1551b8a5 5/5 0 subscription 2026-11-24 17:12 UTC

Reviewed 3b5337f2543e · panel: codex:gpt-6.1-sol + claude-code:sonnet · subscription engine · 51s · about this reviewer

Maintainer commands

@TimeToBuildBob review (own line) — fresh review · @TimeToBuildBob fix — a worker acts on the findings. Once per comment; 👀 = received.

Comment thread scripts/tests/test_bump_submodules.py Resolved
Git-Session-Id: bb2dcf34-a2f6-4d48-9c9a-0a3159624584
@TimeToBuildBob

This comment has been minimized.

Comment thread scripts/bump-submodules.sh Resolved
Comment thread scripts/tests/test_bump_submodules.py Resolved
Git-Session-Id: bb2dcf34-a2f6-4d48-9c9a-0a3159624584
@TimeToBuildBob

This comment has been minimized.

Git-Session-Id: bb2dcf34-a2f6-4d48-9c9a-0a3159624584
@TimeToBuildBob

Copy link
Copy Markdown
Contributor Author

@greptileai review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant